package com.javaIO.demo2;

import java.io.*;

public class Test2 {
    public static void main(String[] args) throws IOException {

        InputStreamReader reader = new InputStreamReader(new FileInputStream("D:\\SoftDevelopment\\Java\\file\\test.txt"));
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream("D:\\SoftDevelopment\\Java\\file\\demo\\test.txt"));
        char[] buf = new char[1024];

        int len;
        while ((len = reader.read(buf)) != -1) {
            System.out.println(new String(buf, 0, len));
            outputStreamWriter.write(buf, 0, len);
        }
        outputStreamWriter.close();
        reader.close();
    }
}
